Skip to content

Comments

Fix: Lowered scriptable GC#377

Merged
crashkonijn merged 1 commit intomasterfrom
fix/lowered-scriptable-gc
Dec 11, 2025
Merged

Fix: Lowered scriptable GC#377
crashkonijn merged 1 commit intomasterfrom
fix/lowered-scriptable-gc

Conversation

@crashkonijn
Copy link
Owner

This pull request refactors how configuration lists are constructed in the AgentTypeScriptable and CapabilityConfigScriptable classes to improve clarity and efficiency. Instead of using LINQ's Select and SelectMany, the code now explicitly iterates through collections and builds the configuration lists step by step. This approach makes the logic clearer and easier to debug, especially for complex nested object creation.

Key changes include:

Refactoring of configuration aggregation:

  • In AgentTypeScriptable, replaced LINQ aggregation with explicit loops to build lists of goals, actions, and sensors, improving readability and maintainability.
  • In CapabilityConfigScriptable, replaced LINQ-based construction of actions, goals, and sensors with explicit loops and intermediate lists, allowing for clearer logic and easier debugging.

Code cleanup:

  • Removed unused using System.Linq; directives from both AgentTypeScriptable.cs and CapabilityConfigScriptable.cs as LINQ is no longer used.

Should fix #359

@github-actions github-actions bot added the bug label Dec 11, 2025
@crashkonijn crashkonijn merged commit ab68ad5 into master Dec 11, 2025
7 checks passed
@crashkonijn crashkonijn deleted the fix/lowered-scriptable-gc branch December 11, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: High GC when loading agent type scriptables

1 participant